package com.example.layouttext628cxy;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private TextView textView;
    private EditText editText5,editText6;
    private Button button6,button7;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.relativelayout1);
        init();
    }
    private void init() {
        editText5 = (EditText) findViewById(R.id.editText5);
        editText6 = (EditText) findViewById(R.id.editText6);
        textView = (TextView) findViewById(R.id.textView);
        button6 = (Button) findViewById(R.id.button6);
        button7 = (Button) findViewById(R.id.button7);
        button7.setOnClickListener(this);
        button6.setOnClickListener(this);
    }

    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button:
                String str1 = editText5.getText().toString();
                String str2 = editText6.getText().toString();
                Toast.makeText(this,str1,Toast.LENGTH_LONG).show();
                Toast.makeText(this,str2, Toast.LENGTH_LONG).show();
                break;
            case R.id.button7:
                Intent intent=new Intent(MainActivity.this,RelativeLayout.class);
                startActivity(intent);
                break;

        }
    }

}
